import axios from "axios";
import ReadBlobString from './ReadBlobString';

/**
 * 读取文件内容
 * @param url 网络地址
 * @param charset 字符编码
 */
export default async function ReadFileString(url: string, charset: string) {
	const { data } = await axios.get(url, { responseType: 'blob' });
	const str = await ReadBlobString(data, charset);
	return str;
}
